<template>
  <el-dialog
      title="文件下载"
      :append-to-body="true"
      :visible.sync="visible"
      width="600px"
      height="300px"
      :close-on-click-modal="false"
  >
   <div style="flex-direction: column;">
     <el-label style="margin-top: 20px">选择下载目录:</el-label>
     <el-input v-model="input" style="margin-top: 20px"></el-input>
     <el-button type="primary" @click="submit()" style="margin-top: 20px">确 定</el-button>
   </div>

  </el-dialog>
</template>

<script>
import Cookies from 'js-cookie'
export default {
  data () {
    return {
     input:'D:\\',
     visible:false,
      url: '',
      //文件夹路径
      filePath:'请选择文件所在路径',
    }
  },
  methods: {
    init (url) {
      this.visible = true

      console.log(this.visible)
      this.url=url;
    },

    submit() {

      this.$http.get('/sys/oss/download',{
        params:{pathName:this.input,url:this.url}
      }).then(({ data: res }) => {
        if (res.code !== 0) {
          return this.$message.error(res.msg)
        }

      }).catch(() => {})
      this.visible=false
    }

  }
}
</script>
